package com.home_school_platform.util;


import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * MD5加密工具类
 * @author 卓汉杰
* */
public class MD5Utils {

    //加盐
    private static final String salt = "sssssdifjkldsalzfjlkfsdjfmlksdmvvlsjfoilsjfpocsdjvfgfb";

    //哈希散列
    private static final int hash = 14;

    /**
     * 把明文转密文
     * @param text 需要加密的明文
     * @return 加密后的结果
     * */
    public static String textToMd5(String text) {
        Md5Hash md5Hash = new Md5Hash(text,salt,hash);

        return md5Hash.toHex();
    }

}
